@import '~antd/lib/style/themes/default.less';

@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
@site-text-color: #314659;
@site-border-color-split: #ebedf0;

.content {
  margin-left: 275px;
}

.hide_markdown {
  position: absolute;
  top:-100000px;
  left:-100000px;
}

:global {
  .main-wrapper {
    position: relative;
    padding: 40px 0 0;
    background: #fff;
  }

  .main-container {
    position: relative;
    min-height: 500px;
    padding: 0 210px 144px 64px;
    overflow: hidden;
    background: #fff;
  }

  .main-menu {
    z-index: 1;

    &-inner {
      max-height: 100vh;
      overflow-x: hidden;
      overflow-y: hidden;
    }

    &:hover &-inner {
      overflow-y: auto;
    }
  }


  .aside-container {
    padding-bottom: 48px;
    font-family: Avenir, @font-family, sans-serif;

    &.ant-menu-inline .ant-menu-submenu-title h4,
    &.ant-menu-inline > .ant-menu-item,
    &.ant-menu-inline .ant-menu-item a {
      overflow: hidden;
      font-size: 14px;
      text-overflow: ellipsis;
    }

    &.ant-menu-inline .ant-menu-item-group-title {
      padding-left: 56px;
    }

    a[disabled] {
      color: #ccc;
    }

    .menu-item-link-outside {
      position: relative;

      .anticon {
        position: absolute;
        top: 16px;
        right: -10px;
        color: @primary-color;
        font-size: 12px;
        opacity: 0;
        transition: all 0.3s;
      }

      &:hover .anticon {
        opacity: 1;
      }
    }
  }

  // reset menu text color
  .menu-site .ant-menu-item > a {
    color: @site-text-color;
  }

  .menu-site .ant-menu-item-selected > a,
  .menu-site .ant-menu-item > a:hover {
    color: @primary-color;
  }

  .drawer-content {
    padding: 40px 0;
  }

  .drawer {
    z-index: 1029;
  }

  @media only screen and (max-width: 991.99px) {
    .main-menu {
      > div > .ant-affix {
        position: static !important;
      }

      .main-menu-inner {
        max-height: none;
        overflow: hidden;
      }
    }
  }


  @media only screen and (max-width: 767.99px) {
    .image-wrapper {
      display: none;
    }

    .toc {
      display: none;
    }

    .nav-phone-icon {
      display: block;
    }

    .main {
      height: calc(100% - 86px);
    }

    .aside-container {
      float: none;
      width: auto;
      padding-bottom: 30px;
      border-right: 0;
    }

    .main-container {
      margin-right: 0;
      padding-right: 16px;
      padding-left: 16px;

      > .markdown > * {
        width: 100% !important;
      }
    }

    .main-wrapper {
      width: 100%;
      margin: 0;
      border-radius: 0;
    }

    .drawer {
      .ant-menu-inline .ant-menu-item::after,
      .ant-menu-vertical .ant-menu-item::after {
        right: auto;
        left: 0;
      }
    }
  }
}

// stylelint-disable
:global {
  /**
   * @link https://gist.github.com/corwien/0bd45c84590464db3bebd0a1fb8dfb3c
   */

  .markdown-body,
  .editor-preview-side,
  .editor-preview-active-side {
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    color: #636b6f;
    line-height: 2;
    word-wrap: break-word;

    a {
      background: transparent;
    }

    a:active,
    a:hover {
      outline: 0;
    }

    pre[class*='language-'] {
      margin: 1.2em 0 !important;
    }

    strong {
      font-weight: bold;
    }

    h1 {
      font-size: 2em;
      margin: 0.67em 0;
    }

    img {
      border: 0;
    }

    hr {
      -moz-box-sizing: content-box;
      box-sizing: content-box;
      height: 0;
    }

    table {
      border-collapse: collapse;
      border-spacing: 0;
    }

    td,
    th {
      padding: 0;
    }

    * {
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }

    a {
      text-decoration: none;
    }

    a:hover,
    a:focus,
    a:active {
      text-decoration: underline;
    }

    hr {
      height: 0;
      margin: 15px 0;
      overflow: hidden;
      background: transparent;
      border: 0;
      border-bottom: 1px solid #ddd;
    }

    hr:before,
    hr:after {
      display: table;
      content: ' ';
    }

    hr:after {
      clear: both;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      margin-top: 15px;
      margin-bottom: 15px;
      line-height: 1.1;
    }

    h1 {
      font-size: 30px;
    }

    h2 {
      font-size: 21px;
    }

    h3 {
      font-size: 16px;
    }

    h4 {
      font-size: 14px;
    }

    h5 {
      font-size: 12px;
    }

    h6 {
      font-size: 11px;
    }

    blockquote {
      margin: 0;
    }

    ul,
    ol {
      padding: 0;
      margin-top: 0;
      margin-bottom: 0;
    }

    ol ol {
      list-style-type: lower-roman;
    }

    dd {
      margin-left: 0;
    }

    code,
    pre {
      font-family: 'Lucida Console',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;
      font-size: 1em;
    }

    pre {
      margin-top: 0;
      margin-bottom: 0;
      overflow: auto;
    }

    .markdown-body > *:first-child {
      margin-top: 0 !important;
    }

    .markdown-body > *:last-child {
      margin-bottom: 0 !important;
    }

    .anchor:hover,.anchor:focus {
      outline: none;
      text-decoration: none;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
      position: relative;
      margin-top: 1em;
      margin-bottom: 16px;
      font-weight: bold;
      line-height: 1.4;
    }

    h1 {
      padding-bottom: 0.3em;
      font-size: 2.25em;
      line-height: 1.2;
    }

    h2 {
      padding-bottom: 0.3em;
      font-size: 1.75em;
      line-height: 1.225;
      border-bottom: 1px solid #eee;
    }

    h3 {
      font-size: 1.5em;
      line-height: 1.43;
    }

    h4 {
      font-size: 1.25em;
    }

    h5 {
      font-size: 1em;
    }

    h6 {
      font-size: 1em;
      color: #777;
    }

    p,
    blockquote,
    ul,
    ol,
    dl,
    table,
    pre {
      margin-top: 0;
      margin-bottom: 10px;
    }

    hr {
      height: 4px;
      padding: 0;
      margin: 16px 0;
      background-color: #e7e7e7;
      border: 0 none;
    }

    ul > li {
        margin-left: 20px;
        padding-left: 4px;
        list-style-type: circle;
    }

    ol > li {
        margin-left: 20px;
        padding-left: 4px;
        list-style-type: decimal;
    }

    ol ol,
    ol ul {
      margin-top: 0;
      margin-bottom: 0;
    }

    li > p {
      margin-top: 16px;
    }

    dl {
      padding: 0;
    }

    dl dt {
      padding: 0;
      margin-top: 16px;
      font-size: 1em;
      font-style: italic;
      font-weight: bold;
    }

    dl dd {
      padding: 0 16px;
      margin-bottom: 16px;
    }

    blockquote {
      font-size: inherit;
      padding: 0 15px;
      color: #7f8c8d;
      border-left: 4px solid #ecf0f1;
    }

    blockquote > :first-child {
      margin-top: 20px;
    }

    blockquote > :last-child {
      margin-bottom: 20px;
    }

    blockquote {
      margin: 20px 0 !important;
      background-color: rgba(102, 128, 153, 0.03);
      padding: 6px 8px;
    }

    table {
      display: block;
      width: 100%;
      overflow: auto;
      margin: 25px 0;
    }

    table th {
      font-weight: bold;
    }

    table th,
    table td {
      padding: 6px 13px;
      border: 1px solid #ddd;
    }

    table tr {
      background-color: #fff;
      border-top: 1px solid #ccc;
    }

    table tr:nth-child(2n) {
      background-color: #f8f8f8;
    }

    img {
      max-width: 100%;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }

    img:not(.emoji) {
      margin-bottom: 30px;
      margin-top: 10px;
      margin-left: 2%;
    }

    code {
      margin: 0;
      color: #c2627b;
      background-color: rgba(0, 0, 0, 0.04);
      border-radius: 3px;
      background-color: #ecf0f1;
      max-width: 740px;
      overflow-x: auto;
    }

    code:before,
    code:after {
      content: '\00a0';
    }

    pre > code {
      padding: 0;
      margin: 0;
      font-size: 100%;
      white-space: pre;
      background: transparent;
      border: 0;
      color: #e6e8d3;
    }

    .highlight {
      margin-bottom: 16px;
    }

    .highlight pre,
    pre {
      padding: 14px;
      overflow: auto;
      line-height: 1.45;
      background-color: #f8f8f8;
      border-radius: 3px;
      color: #fff;
      border: none;
    }

    .highlight pre {
      margin-bottom: 0;
    }

    pre {
      word-wrap: normal;
      position: relative;
    }

    pre code {
      padding: 0;
      margin: 0;
      overflow: initial;
      line-height: inherit;
      word-wrap: normal;
      background-color: transparent;
      border: 0;
      color: #c2627b;
    }

    pre code:before,
    pre code:after {
      content: normal;
    }

    p.tip {
      padding: 12px 24px 12px 30px;
      margin: 2em 0;
      border-left-width: 4px;
      border-left-style: solid;
      background-color: #f8f8f8;
      position: relative;
      border-bottom-right-radius: 2px;
      border-top-right-radius: 2px;
    }
    p.tip:before {
      position: absolute;
      top: 14px;
      left: -12px;
      color: #fff;
      width: 20px;
      height: 20px;
      border-radius: 100%;
      text-align: center;
      line-height: 20px;
      font-weight: bold;
      font-family: "Dosis", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
      font-size: 14px;
    }
    p.tip code {
      background-color: #efefef;
    }
    p.tip {
      border-left-color: #f66;
    }
    p.tip:before {
      content: "!";
      background-color: #f66;
    }

    pre code.language-php::before,
    pre code.language-js::before,
    pre code.language-html::before,
    pre code.language-go::before,
    pre code.language-python::before,
    pre code.language-nginx::before,
    pre code.language-json::before,
    pre code.language-css::before,
    pre code.language-java::before,
    pre code.language-bash::before,
    pre code.language-sql::before {
      font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
      position: absolute;
      top: 0;
      right: 0;
      color: #ccc;
      text-align: right;
      font-size: 0.9em;
      padding: 5px 10px 0;
      line-height: 15px;
      height: 15px;
      font-weight: 500;
    }
    pre code.language-php::before {
      content: "PHP";
    }
    pre code.language-html::before {
      content: "HTML";
    }
    pre code.language-js::before {
      content: "JS";
    }
    pre code.language-go::before {
      content: "Golang";
    }
    pre code.language-python::before {
      content: "Python";
    }
    pre code.language-json::before {
      content: "JSON";
    }
    pre code.language-bash::before {
      content: "Shell";
    }
    pre code.language-css::before {
      content: "CSS";
    }
    pre code.language-sql::before {
      content: "SQL";
    }
    pre code.language-java::before {
      content: "Java";
    }
    pre code.language-nginx::before {
      content: "Nginx";
    }
  }
}

:global {
  .ant-layout-header {
    background: #fff;
  }

  .markdown-body {
    font-size: 14px;
    background: white;
    :not(pre) > code[class*='language-'],
    pre[class*='language-'] {
      background: rgba(54, 56, 58, 0.98);
    }

    code {
      border: 1px solid #e4e4e4;
    }

    img:not(.emoji) {
      max-width: 60%;
      box-shadow: 0 0 20px #ccc;
    }

    blockquote {
      > :first-child {
        margin-top: 0;
      }

      > :last-child {
        margin-bottom: 0;
      }
    }

    hr {
      clear: both;
      height: 1px;
      margin: 18px 0;
      background: #ebedf0;
      border: 0;
    }

    .anchor {
      margin-left: 8px;
      opacity: 0;
      -webkit-transition: opacity .3s ease;
      transition: opacity .3s ease
    }

    h1:hover .anchor,h2:hover .anchor,h3:hover .anchor {
        opacity: 1;
    }

    .hljs-comment{
      color: #999
    }
  }

  .toc {
    margin: 16px 0;
    padding-left: 0;
    font-size: 12px;
    list-style: none;
    border-left: 1px solid @site-border-color-split;
  }

  ul.toc > li {
    margin-left: 0;
    padding-left: 0;
    line-height: 1.5;
    list-style: none;
    &:not(:last-child) {
      margin-bottom: 4px;
    }
  }

  .toc li > ul {
    display: none;
    font-size: 12px;
    text-indent: 8px;
  }

  .toc a {
    display: block;
    width: 150px;
    margin-left: -1px;
    padding-left: 16px;
    overflow: hidden;
    color: @site-text-color;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-left: 1px solid transparent;
    transition: all 0.3s ease;
  }

  .toc a:hover {
    color: @primary-color;
  }

  .toc a.current {
    color: @primary-color;
    border-color: @primary-color;
  }

  .toc-affix {
    position: absolute;
    top: 8px;
    right: 20px;
    .ant-affix {
      z-index: 9;
      max-height: ~'calc(100vh - 16px)';
      overflow: auto;
      background: #fff;
    }
  }

  .toc-affix-bottom {
    position: absolute;
    right: 20px;
    bottom: 88px;
    .ant-affix {
      background: #fff;
    }
  }
}

